<script setup lang="ts">
import { reactive, ref } from 'vue'
import NavBar from '@/components/NavBar.vue'
import MyList from '../components/MyList.vue'
import NoData from '@/components/NoData/NoData.vue'
let navList = ref<string[]>(['我发起的', '我收到的', '互换成功'])
let current = ref<number>(0)
//传入的数据
let data = reactive([
  {
    id: 1,
    name: '张三',
    sex: 'M',
    age: 18,
    height: 170,
    address: '北京',
    time: '1天前',
  },
  {
    id: 2,
    name: '张三',
    sex: 'F',
    age: 18,
    height: 170,
    address: '北京',
    time: '1天前',
  },
])
</script>
<template>
  <!-- 我的互换 -->
  <NavBar
    :navList="navList"
    @change="
      (index) => {
        current = index
      }
    "
  />
  <view class="main">
    <template v-if="data.length > 0">
      <MyList :data="data" />
    </template>
    <NoData v-else />
  </view>
</template>
<style lang="scss" scoped>
.main {
  width: 100%;
  height: calc(100vh - 100px);
}
</style>
